package cn.lzj.service.User.impl.product;

import cn.lzj.mapper.ProductMapper;
import cn.lzj.pojo.ProductBase;
import cn.lzj.pojo.ProductType;
import cn.lzj.pojo.User;
import cn.lzj.service.User.ProductService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {


    @Resource
    private ProductMapper productMapper;

    @Override
    public ProductBase getProductById(Integer productId) {

        return productMapper.getProductById(productId);
    }

    @Override
    public void addProduct(ProductBase product) {
        productMapper.addProduct(product);
    }

    @Override
    public List<ProductBase> selectProductByUserId(User user) {
        return productMapper.selectProductByUserId(user);
    }

    @Override
    public void updateProduct(ProductBase product) {
        productMapper.updateProduct(product);
    }

    @Override
    public List<ProductBase> selectProductByTypeId(ProductType productType) {
        return productMapper.selectProductByTypeId(productType);
    }
}
